package com.txunda.zhuohired.aty.manage.home;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.View;
import android.widget.TextView;

import com.ants.theantsgo.util.L;
import com.lidroid.xutils.view.annotation.ViewInject;
import com.lidroid.xutils.view.annotation.event.OnClick;
import com.txunda.zhuohired.R;
import com.txunda.zhuohired.base.BaseAty;
import com.txunda.zhuohired.dialog.DateDialog;
import com.txunda.zhuohired.dialog.SelectJobTimeDialog;

/**
 * 创建人： Txd_Cjh
 * 创建时间： 2018/3/13 13:48
 * 功能描述：工作时间
 * 联系方式：jiahuanchen@126.com
 */

public class SettingJobTimeAty extends BaseAty {
    /**
     * 标题
     */
    @ViewInject(R.id.tv_layout_white_center)
    private TextView tv_layout_white_center;
    /**
     * 保存
     */
    @ViewInject(R.id.tv_layout_white_right)
    private TextView tv_layout_white_right;

    /**
     * 开始日期
     */
    @ViewInject(R.id.tv_setting_job_time_start)
    private TextView tv_setting_job_time_start;
    /**
     * 结束日期
     */
    @ViewInject(R.id.tv_setting_job_time_end)
    private TextView tv_setting_job_time_end;
    /**
     * 工作时间
     */
    @ViewInject(R.id.tv_setting_job_time)
    private TextView tv_setting_job_time;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        showStatusBar(R.id.layout_white_head);
        tv_layout_white_center.setText("工作时间");
        tv_layout_white_right.setVisibility(View.VISIBLE);
        tv_layout_white_right.setText("保存");
    }

    @Override
    @OnClick({R.id.ll_setting_job_time_start,R.id.ll_setting_job_time_end,R.id.ll_setting_job_time})
    public void onClick(View v) {
        super.onClick(v);
        switch (v.getId()){
            case R.id.ll_setting_job_time_start://开始日期
                DateDialog dateDialog = new DateDialog(this, "请选择开始日期", new DateDialog.SelectBirthdayListener() {
                    @Override
                    public void onSelectBirthday(String birthday) {
                        tv_setting_job_time_start.setText(birthday);
                    }
                });
                dateDialog.show();
                break;
            case R.id.ll_setting_job_time_end://结束日期
                DateDialog dateDialog1 = new DateDialog(this, "请选择结束日期", new DateDialog.SelectBirthdayListener() {
                    @Override
                    public void onSelectBirthday(String birthday) {
                        tv_setting_job_time_end.setText(birthday);
                    }
                });
                dateDialog1.show();
                break;
            case R.id.ll_setting_job_time://工作时间
                SelectJobTimeDialog selectJobTimeDialog = new SelectJobTimeDialog(this, new SelectJobTimeDialog
                        .SelectTimeListener() {


                    @Override
                    public void onSelectTime(String time) {
                        L.e("===================", time);
                        tv_setting_job_time.setText(time);
                    }
                });
                selectJobTimeDialog.show();
                break;
        }
    }

    @Override
    protected int getLayoutResId() {
        return R.layout.aty_setting_job_time;
    }

    @Override
    protected void initialized() {

    }

    @Override
    protected void requestData() {

    }
}
